package com.stoken.service.impl;

import java.text.ParseException;

import org.quartz.CronTrigger;
import org.quartz.JobDetail;
import org.quartz.Scheduler;
import org.quartz.SchedulerException;
import org.quartz.SchedulerFactory;
import org.quartz.impl.StdSchedulerFactory;

public class QuartzManger {
	
	private SchedulerFactory sf = null;
	
	public QuartzManger(){
		sf  = new StdSchedulerFactory();
	}
	
	public void startHitBonus() throws SchedulerException, ParseException{
		Scheduler sched = sf.getScheduler();
		JobDetail job = new JobDetail("job1", "group1", CalculationHitJob.class);
		CronTrigger trigger = new CronTrigger("trigger1", "group1", "job1", "group1", "0 0/2 * * * ?");
		sched.scheduleJob(job, trigger);
		sched.start();
		
	}
	
	
	
}
